<?php
session_start();include "conn.php";
?>
<?php  include("admin.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Bios 管理中心 </title>
<link href="../css/control.css" rel="stylesheet" type="text/css" />
</head>

<body>
   <script language="javascript">
function check(form){
if (document.form1.title.value=="")
{alert("請填寫 標題！");document.form1.title.focus();return false;
}


if (document.form1.begintime.value=="0000-00-00")
{alert("請選擇 發佈時間！");document.form1.title.focus();return false;
}

if (document.form1.endtime.value=="0000-00-00")
{alert("請選擇 結束時間！");document.form1.title.focus();return false;
}

}
</script>





<a name="top" id="top"></a>
<div id="all"><!--Wrap start //-->
<div id="main" class="clearfix"><!--main start //-->
<div id="top-1"><?php include_once('blog_top_btn.php');?>
</div>
<!--Content for  id "submenu" Goes Here //-->
<div id="submenu">
<?php include_once('ad_sale_main_btn.php');?>
  </div>
  
 <!--Content for  id "contact" Goes Here //-->
 
 
 
 
 <script language="javascript">
/****************
* 由于字数限制，请下载附件看使用说明．
*******如果您使用本日历控件 请保留该信息 谢谢! ***********   
* http://2lin.net
* Email:caoailin@gmail.com 
* QQ:38062022 
* Creation date: 2006-11-22 
******************/


function Calendar(objName)  

{  
this.style = {
borderColor         : "#909eff", //边框颜色
headerBackColor      : "#909EFF", //表头背景颜色
headerFontColor      : "#ffffff", //表头字体颜色
bodyBarBackColor    : "#f4f4f4", //日历标题背景色
bodyBarFontColor    : "#000000", //日历标题字体色
bodyBackColor       : "#ffffff", //日历背景色
bodyFontColor            : "#000000", //日历字体色 
bodyHolidayFontColor     : "#ff0000", //假日字体色
watermarkColor       : "#d4d4d4",  //背景水印色
moreDayColor             : "#cccccc" 
};
this.showMoreDay = false; //是否显示上月和下月的日期
this.Obj = objName;  
this.date = null;
this.mouseOffset = null;
this.dateInput = null;
this.timer = null; 
};
Calendar.prototype.toString = function()
{   
var str = this.getStyle();
str += '<div Author="alin" class="calendar" style="display:none;" onselectstart="return false" oncontextmenu="return false" id="Calendar">\n';
str += '<div Author="alin" class="cdrWatermark" id="cdrWatermark"></div><div id="cdrBody" style="position:absolute;left:0px;top:0px;z-index:2;width:140px;">';
str += this.getHeader();
str += this.getBody();   
str += '</div><div Author="alin" id="cdrMenu" style="position:absolute;left:0px;top:0px;z-index:3;display:none;"  onmouseover="' + this.Obj + '.showMenu(null);" onmouseout="' + this.Obj + '.hideMenu();"></div></div>';
return str;
};
Calendar.prototype.getStyle = function()
{
var str = '<style type="text/css">\n';
str += '.calendar{position:absolute;width:140px!important;width /**/:142px;height:212px!important;height /**/:174px;background-color:'+this.style.bodyBackColor+';border:1px solid ' + this.style.borderColor + ';left:0px;top:0px;z-index:9999;}\n';
str += '.cdrHeader{background-color:'+ this.style.headerBackColor +';width:140px;height:22px;font-size:12px;color:'+this.style.headerFontColor+';}\n';
str += '.cdrWatermark{position:absolute;left:0px;top:80px;width:140px;font-family: Arial Black;font-size:50px;color:'+this.style.watermarkColor+';z-index:1;text-align:center;}\n';
str += '.cdrBodyBar{background-color:' + this.style.bodyBarBackColor + ';font-size:12px;color:' + this.style.bodyBarFontColor + ';width:140px;height:20px;}\n';
str += '.cdrBody{width:140px;height:122px!important; height /**/:110px;font-size:12px;cursor:pointer;color:' + this.style.bodyFontColor + ';}\n';
str += '.dayOver{height:16px;padding:0px;border:1px solid black;background-color:#f4f4f4;}\n';
str += '.dayOut{padding:1px;border:none;height:16px;}\n';
str += '.menuOver{background-color:'+this.style.headerBackColor+';color:'+this.style.headerFontColor+';font-size:12px;}\n';
str += '.headerOver{border:1px solid black;background-color:#f4f4f4;color:black;cursor:default;}\n';
str += '.cdrMenu{font-size:12px;border:1px solid #000000;background-color:#ffffff;cursor:default;width:100%}\n';
str += 'html>body #Calendar{width:142px;174px;}';
str += '</style>\n'; 
return str;
};
Calendar.prototype.getHeader = function()
{
var str = '<table Author="alin" class="cdrHeader" cellSpacing="2" cellPadding="0"><tr Author="alin" align="center">\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" onmouseout="this.className=\'\'" id="previousYear" title="上一年份" style="cursor:pointer;width:10px;" onclick="'+this.Obj+'.onChangeYear(false);"><<</td>\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" onmouseout="this.className=\'\'" id="previousMonth" title="上一月份" style="cursor:pointer;width:10px;" onclick="'+this.Obj+'.onChangeMonth(false);"><</td>\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" id="currentYear" style="width:50px;" onclick="' + this.Obj + '.showMenu(true);" onmouseout="' + this.Obj + '.hideMenu();this.className=\'\';">0</td>\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" id="currentMonth" onclick="' + this.Obj + '.showMenu(false);" onmouseout="' + this.Obj + '.hideMenu();this.className=\'\';">0</td>\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" onmouseout="this.className=\'\'" id="nextMonth" title="下一月份" style="cursor:pointer;width:10px;" onclick="'+this.Obj+'.onChangeMonth(true);">></td>\n';
str += '<td Author="alin" onmouseover="this.className=\'headerOver\'" onmouseout="this.className=\'\'" id="nextYear" title="下一年份" style="cursor:pointer;width:10px;" onclick="'+this.Obj+'.onChangeYear(true);">>></td></tr>\n';
str += '</table>\n';
return str;
};
Calendar.prototype.getBody = function()
{
var n = 0;
var str = this.getBodyBar();
str += '<table Author="alin" class="cdrBody" cellSpacing="2" cellPadding="0">\n';   
for(i = 0; i < 6; i++)
{   
str += '<tr Author="alin" align="center">';
for(j = 0; j < 7; j++)
{
str += '<td Author="alin" class="dayOut" id="cdrDay'+(n++)+'" width="13%"></td>\n';
}
str += '</tr>';
}
str += '</table>\n';
str += '<table Author="alin" class="cdrBodyBar" cellSpacing="2" cellPadding="0" ><tr align="center" Author="alin"><td Author="alin" valign="top" style="cursor:pointer;" onclick="'+this.Obj+'.getToday();">今天：'+new Date().toFormatString("yyyy年mm月dd日")+'</td></tr></table>\n';



return str;

};

Calendar.prototype.getBodyBar = function()
{
var str = '<table Author="alin_bar" id="cdrBodyBar" class="cdrBodyBar" style="cursor:move;" cellSpacing="2" cellPadding="0"><tr Author="alin_bar" align="center">\n';
var day = new Array('日','一','二','三','四','五','六');
for(i = 0; i < 7; i++)
{
str += '<td Author="alin_bar">' + day[i] + '</td>\n';     
}
str += '</tr></table>';
return str;  
}
Calendar.prototype.getYearMenu = function(year)
{
var str = '<table Author="alin" cellSpacing="0" class="cdrMenu" cellPadding="0">\n';
for(i = 0; i < 10; i++)
{   
var _year = year + i;
var _date = new Date(_year,this.date.getMonth(),this.date.getDate());
str += '<tr Author="alin" align="center"><td Author="alin" width="13%" height="16" ';
if(this.date.getFullYear() != _year)
{
str += 'style="color:#000000" ';//111111111
str += 'onmouseover="this.className=\'menuOver\'" onmouseout="this.className=\'\'" ';
}
else
{
str += 'style="color:#FF0000" ';//111111111
}
str += 'onclick="' + this.Obj + '.bindDate(\'' + _date.toFormatString("-") + '\')">' + _year + '年</td>\n';  
str += '</tr>';
}
str += '<tr Author="alin" align="center"><td Author="alin"><table Author="alin" style="font-size:12px;width:100%;" cellSpacing="0" cellPadding="0">\n';
str += '<tr Author="alin" align="center"><td  style="color:#000000"  Author="alin" onmouseover="this.className=\'menuOver\'" onmouseout="this.className=\'\'" onclick="'+this.Obj+'.getYearMenu('+ (year - 10) + ')"><<</td>\n';
str += '<td style="color:#000000" Author="alin" onmouseover="this.className=\'menuOver\'" onmouseout="this.className=\'\'" onclick="'+this.Obj+'.getYearMenu('+ (year + 10) +')">>></td><tr>\n';
str += '</table></td></tr>\n';
str += '</table>';
var _menu = getObjById("cdrMenu");
_menu.innerHTML = str;
};
Calendar.prototype.getMonthMenu = function()
{
var str = '<table Author="alin" cellSpacing="0" class="cdrMenu" cellPadding="0">\n';
for(i = 1; i <= 12; i++)
{   
var _date = new Date(this.date.getFullYear(),i-1,this.date.getDate());  
str += '</tr><tr Author="alin" align="center"><td Author="alin" height="16" ';
if(this.date.getMonth() + 1 != i)
{
str += 'style="color:#000000" ';//111111111
str += 'onmouseover="this.className=\'menuOver\'" onmouseout="this.className=\'\'" ';
}
else
{
str += 'style="color:#FF0000" ';//111111111
}
str += 'onclick="' + this.Obj + '.bindDate(\'' + _date.toFormatString("-") + '\')">'+i+'月</td></tr>\n';
}
str += '</table>';
var _menu = getObjById("cdrMenu");
_menu.innerHTML = str;   
};
Calendar.prototype.show = function()
{
if (arguments.length >  3  || arguments.length == 0)
{
alert("對不起！傳入參數不對！" );
return;
}   
var _date = null;
var _evObj = null;
var _initValue = null  
for(i = 0; i < arguments.length; i++)
{
if(typeof(arguments[i]) == "object"  &&  arguments[i].type == "text")
{_date = arguments[i];}
else if(typeof(arguments[i]) == "object")
{_evObj = arguments[i];}
else if(typeof(arguments[i]) == "string")
{_initValue = arguments[i];}  
}
_evObj = _evObj || _date;
inputObj = _date;
targetObj = _evObj
if(!_date){alert("傳放參數錯誤!"); return;}
this.dateInput = _date;
_date = _date.value;
if(_date == ""  &&  _initValue) _date = _initValue;   
this.bindDate(_date);        
var _target = getPosition(_evObj);   
var _obj = getObjById("Calendar");
_obj.style.display = ""; 
_obj.style.left = _target.x + 'px';
if((document.body.clientHeight - (_target.y + _evObj.clientHeight)) >= _obj.clientHeight)
{        
_obj.style.top = (_target.y + _evObj.clientHeight) + 'px';
}
else
{   
_obj.style.top = (_target.y - _obj.clientHeight) + 'px';
}
};
Calendar.prototype.hide = function()
{
var obj = getObjById("Calendar");
obj.style.display = "none";   
};
Calendar.prototype.bindDate = function(date)
{
var _monthDays = new Array(31,30,31,30,31,30,31,31,30,31,30,31); 
var _arr = date.split('-');  
var _date = new Date(_arr[0],_arr[1]-1,_arr[2]); 
if(isNaN(_date)) _date = new Date(); 
this.date = _date;
this.bindHeader(); 
var _year = _date.getFullYear();
var _month = _date.getMonth();
var _day = 1; 
var _startDay = new Date(_year,_month,1).getDay();
var _previYear = _month == 0 ? _year - 1 : _year;
var _previMonth = _month == 0 ? 11 : _month - 1;
var _previDay = _monthDays[_previMonth];
if (_previMonth == 1) _previDay =((_previYear%4==0) && (_previYear%100!=0)||(_previYear%400==0))?29:28; 
_previDay -= _startDay - 1;
var _nextDay = 1;
_monthDays[1] = ((_year%4==0) && (_year%100!=0)||(_year%400==0))?29:28;
for(i = 0; i < 40; i++)
{ 
var _dayElement = getObjById("cdrDay" + i);
_dayElement.onmouseover = Function(this.Obj + ".onMouseOver(this)");
_dayElement.onmouseout = Function(this.Obj + ".onMouseOut(this)");
_dayElement.onclick = Function(this.Obj + ".onClick(this)");
this.onMouseOut(_dayElement);    
_dayElement.style.color = "";
if(i < _startDay)
{
//获取上一个月的日期
if(this.showMoreDay)
{
var _previDate = new Date(_year,_month - 1,_previDay);
_dayElement.innerHTML = _previDay;
_dayElement.title = _previDate.toFormatString("yyyy年mm月dd日");
_dayElement.value = _previDate.toFormatString("-"); 
_dayElement.style.color = this.style.moreDayColor; 
_previDay++;
}else
{
_dayElement.innerHTML = "";
_dayElement.title = "";
}
}
else if(_day > _monthDays[_month])
{
//获取下个月的日期
if(this.showMoreDay)
{
var _nextDate = new Date(_year,_month + 1,_nextDay);
_dayElement.innerHTML = _nextDay;
_dayElement.title = _nextDate.toFormatString("yyyy年mm月dd日");
_dayElement.value = _nextDate.toFormatString("-");
_dayElement.style.color = this.style.moreDayColor; 
_nextDay++;      
}else
{
_dayElement.innerHTML = "";
_dayElement.title = "";
}
}
else if(i >= new Date(_year,_month,1).getDay()  &&  _day <= _monthDays[_month])
{
//获取本月日期
_dayElement.innerHTML = _day;
if(_day == _date.getDate())
{
this.onMouseOver(_dayElement);
_dayElement.onmouseover = Function("");   
_dayElement.onmouseout = Function("");               
}
if(this.isHoliday(_year,_month,_day))
{
_dayElement.style.color = this.style.bodyHolidayFontColor;     
}
var _curDate = new Date(_year, _month, _day);
_dayElement.title =  _curDate.toFormatString("yyyy年mm月dd日");
_dayElement.value = _curDate.toFormatString("-");
_day++;
}
else
{
_dayElement.innerHTML = "";
_dayElement.title = "";
} 
}
var _menu = getObjById("cdrMenu");
_menu.style.display = "none"; 
};
Calendar.prototype.bindHeader = function()
{
var _curYear = getObjById("currentYear");
var _curMonth = getObjById("currentMonth");
var _watermark = getObjById("cdrWatermark");
_curYear.innerHTML = this.date.toFormatString("yyyy年");
_curMonth.innerHTML =  this.date.toFormatString("mm月");
_watermark.innerHTML = this.date.getFullYear();     
}; 
Calendar.prototype.getToday = function()
{
var _date = new Date();
this.bindDate(_date.toFormatString("-"));
}; 
Calendar.prototype.isHoliday = function(year,month,date)
{
var _date = new Date(year,month,date);
return (_date.getDay() == 6 || _date.getDay() == 0);
};
Calendar.prototype.onMouseOver = function(obj)
{
obj.className = "dayOver";
};
Calendar.prototype.onMouseOut = function(obj)
{
obj.className = "dayOut";
}; 
Calendar.prototype.onClick = function(obj)
{  
if(obj.innerHTML != "")  this.dateInput.value = obj.value;
this.hide();
};
Calendar.prototype.onChangeYear = function(isnext)
{
var _year = this.date.getFullYear();
var _month = this.date.getMonth() + 1;
var _date = this.date.getDate();
if(_year > 999  &&  _year <10000)
{
if(isnext){_year++;}else{ _year --;}
}
else
{
alert("年份超出范圍（1000-9999）!");
}
this.bindDate(_year + '-' + _month + '-' + _date);
};
Calendar.prototype.onChangeMonth = function(isnext)
{
var _year = this.date.getFullYear();
var _month = this.date.getMonth() + 1;
var _date = this.date.getDate();
if(isnext){ _month ++;} else {_month--;}
if(_year > 999  &&  _year <10000)
{ 
if(_month < 1) {_month = 12; _year--;}
if(_month > 12) {_month = 1; _year++;}
}
else
{
alert("年份超出范围（1000-9999）!");
}  
this.bindDate(_year + '-' + _month + '-' + _date);
};
Calendar.prototype.showMenu = function(isyear)
{
var _menu = getObjById("cdrMenu");
if(isyear != null)
{    
var _obj = (isyear)? getObjById("currentYear") : getObjById("currentMonth");
if(isyear)
{
this.getYearMenu(this.date.getFullYear() - 5);    
}
else
{
this.getMonthMenu();    
}
_menu.style.top = (_obj.offsetTop + _obj.offsetHeight) + 'px';
_menu.style.left = _obj.offsetLeft + 'px'; 
_menu.style.width = _obj.offsetWidth + 'px';
}
if (this.timer != null) clearTimeout(this.timer);
_menu.style.display="";
}
Calendar.prototype.hideMenu = function()
{
var _obj = getObjById("cdrMenu");
this.timer = window.setTimeout(function(){_obj.style.display='none';},500); 
}
Number.prototype.NaN0 = function()
{
return isNaN(this) ? 0 : this;
}
Date.prototype.toFormatString = function(fs)
{
if(fs.length == 1)
{ 
return this.getFullYear() + fs + (this.getMonth() + 1) + fs + this.getDate(); 
}
fs = fs.replace("yyyy",this.getFullYear());
fs = fs.replace("mm",(this.getMonth() + 1));
fs = fs.replace("dd",this.getDate());
return fs;
}
/************公用方法及变量**************/
var inputObj = null; 
var targetObj = null; 
var dragObj = null; 
var mouseOffset = null; 
function getObjById(obj)
{
if(document.getElementById)
{
return document.getElementById(obj);
}
else
{
alert("流覽器不支持!");
}
}
function mouseCoords(ev)
{
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop  - document.body.clientTop
};
}
function getPosition(e)
{
var left = 0;
var top  = 0;
while (e.offsetParent){
left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
e     = e.offsetParent;
}
left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
return {x:left, y:top};
}
function getMouseOffset(target, ev)
{
ev = ev || window.event;
var docPos    = getPosition(target);
var mousePos  = mouseCoords(ev);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}
function closeCalendar(evt){
evt = evt || window.event; 
var _target= evt.target || evt.srcElement; 
if(!_target.getAttribute("Author")  &&   _target != inputObj  &&  _target != targetObj)
{
getObjById("Calendar").style.display = "none";    
}  
}
function dragStart(evt){
evt = evt || window.event; 
var _target= evt.target || evt.srcElement;
if(_target.getAttribute("Author") == "alin_bar") 
{    
dragObj = getObjById("Calendar");    
mouseOffset = getMouseOffset(dragObj, evt);  
}   
}
function drag(evt)
{
evt =  evt || window.event; 
if(dragObj)
{    
var mousePos = mouseCoords(evt); 
dragObj.style.left = (mousePos.x - mouseOffset.x) + 'px';
dragObj.style.top  = (mousePos.y - mouseOffset.y) + 'px';   
}
}
//拖动结束
function dragEnd(evt)
{
dragObj = null;    
}
/***********End 公用方法*********/
document.onclick = closeCalendar;
document.onmousedown = dragStart;
document.onmousemove = drag;
document.onmouseup = dragEnd;
/*********结束**********/


var c = new Calendar("c");
document.write(c);
c.getToday();




</script>
 
 
 
 
 
 <?php
//文件名。。。
$webname="ad"; 
$linkname="ad-sale-main"; 
?>



<?php 
$id=make_safe($_GET["id"]);

//echo $data;
$action=make_safe($_GET["action"]);
$BigClassName=make_safe($_POST["BigClassName"]);
$enBigClassName=make_safe($_POST["enBigClassName"]);
$SmallClassName=make_safe($_POST["SmallClassName"]);
$enSmallClassName=make_safe($_POST["enSmallClassName"]);
$title=make_safe($_POST["title"]);
$entitle=make_safe($_POST["entitle"]);


$begintime=make_safe($_POST["begintime"]);
$endtime=make_safe($_POST["endtime"]);
$linkisok=make_safe($_POST["linkisok"]);



$link1=make_safe($_POST["link1"]);
$link2=make_safe($_POST["link2"]);
$isok=0;
$hits=0;
//$addtime=make_safe($_POST["addtime"]);
$addtime=$data2;
$edittime=$data2;

$user=make_safe($_POST["user"]);
$content=$_POST["content"];
$encontent=$_POST["encontent"];
$oldimages=make_safe($_POST["oldimages"]);
$oldimages2=make_safe($_POST["oldimages2"]);
$oldimages3=make_safe($_POST["oldimages3"]);
$oldimages4=make_safe($_POST["oldimages4"]);
$oldimages5=make_safe($_POST["oldimages5"]);
$oldimages6=make_safe($_POST["oldimages6"]);
$oldimages7=make_safe($_POST["oldimages7"]);
$oldimages8=make_safe($_POST["oldimages8"]);


include("check.php");


$path = 'upfiles/'. $_FILES['images']['name'];
$type=strstr($path,'.');
$path2 ='upfiles/'.$data."-1".$type;

$path3 = 'upfiles/'. $_FILES['images2']['name'];
$type3=strstr($path3,'.');
$path4 ='upfiles/'.$data."-2".$type3;

$path5 = 'upfiles/'. $_FILES['images3']['name'];
$type5=strstr($path5,'.');
$path6 ='upfiles/'.$data."-3".$type5;

$path7 = 'upfiles/'. $_FILES['images4']['name'];
$type7=strstr($path7,'.');
$path8 ='upfiles/'.$data."-4".$type7;

$path9 = 'upfiles/'. $_FILES['images5']['name'];
$type9=strstr($path9,'.');
$path10 ='upfiles/'.$data."-5".$type9;

$path11 = 'upfiles/'. $_FILES['images6']['name'];
$type11=strstr($path11,'.');
$path12 ='upfiles/'.$data."-6".$type11;

$path13 = 'upfiles/'. $_FILES['images7']['name'];
$type13=strstr($path13,'.');
$path14 ='upfiles/'.$data."-7".$type13;

$path15 = 'upfiles/'. $_FILES['images8']['name'];
$type15=strstr($path15,'.');
$path16 ='upfiles/'.$data."-8".$type15;



$type=strtolower($type); 
$type3=strtolower($type3); 
$type5=strtolower($type5); 
$type7=strtolower($type7); 
$type9=strtolower($type9); 
$type11=strtolower($type11); 
$type13=strtolower($type13);
$type15=strtolower($type15);


 


//修改数据
if($action=="xiugai"){

if($type==".jpg"  or $type==".jpge" or $type==".gif" or $type==".doc" or $type==".xls" or $type==".bmp" or $type==".pdf" ){
move_uploaded_file($_FILES['images']['tmp_name'],$path2);//上传图片
$aa=getimagesize($path2);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
//if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}
//$weight1=960;
//$height1=459;
$resizeimage = new resizeimage($path2, $weight, $height, "0","big/".$path2);
$resizeimage = new resizeimage($path2, "190", "69", "0","pic/".$path2);
if($path2 !='upfiles/'.$data."-1"){unlink($path2);}
if($oldimages!=""){unlink($oldimages);unlink("big/".$oldimages);unlink("pic/".$oldimages);}//删除旧图片
}
else
{
$path2=$oldimages;
}

if($type3==".jpg"  or $type3==".jpge" or $type3==".gif" or $type3==".doc" or $type3==".xls" or $type3==".bmp" or $type3==".pdf" ){
move_uploaded_file($_FILES['images2']['tmp_name'],$path4);//上传图片
$aa=getimagesize($path4);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
//if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}
//$weight1=892;
//$height1=325;
$resizeimage = new resizeimage($path4, $weight, $height, "0","big/".$path4);
$resizeimage = new resizeimage($path4, "190", "69", "0","pic/".$path4);
if($path4 !='upfiles/'.$data."-2"){unlink($path4);}
if($oldimages2!=""){unlink($oldimages2);unlink("big/".$oldimages2);unlink("pic/".$oldimages2);}//删除旧图片
}
else
{
$path4=$oldimages2;
}
 
if($type5==".jpg"  or $type5==".jpge" or $type5==".gif" or $type5==".doc" or $type5==".xls" or $type5==".bmp" or $type5==".pdf" ){
move_uploaded_file($_FILES['images3']['tmp_name'],$path6);//上传图片
$aa=getimagesize($path6);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
//if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}
//$weight1=190;
//$height1=66;
$resizeimage = new resizeimage($path6, $weight, $height, "0","big/".$path6);
$resizeimage = new resizeimage($path6, "190", "69", "0","pic/".$path6);
if($path6 !='upfiles/'.$data."-3"){unlink($path6);}
if($oldimages3!=""){unlink($oldimages3);unlink("big/".$oldimages3);unlink("pic/".$oldimages3);}//删除旧图片
}
else
{
$path6=$oldimages3;
}

if($type7==".jpg"  or $type7==".jpge" or $type7==".gif" or $type7==".doc" or $type7==".xls" or $type7==".bmp" or $type7==".pdf" ){
move_uploaded_file($_FILES['images4']['tmp_name'],$path8);//上传图片
$resizeimage = new resizeimage($path8, "200", "100", "0","pic/".$path8);
if($oldimages4!=""){unlink($oldimages4);unlink("pic/".$oldimages4);}//删除旧图片
}
else
{
$path8=$oldimages4;
}

if($type9==".jpg"  or $type9==".jpge" or $type9==".gif" or $type9==".doc" or $type9==".xls" or $type9==".bmp" or $type9==".pdf" ){
move_uploaded_file($_FILES['images5']['tmp_name'],$path10);//上传图片
$resizeimage = new resizeimage($path10, "200", "100", "0","pic/".$path10);
if($path10 !='upfiles/'.$data."-5"){unlink($path10);}
if($oldimages5!=""){unlink($oldimages5);unlink("pic/".$oldimages5);}//删除旧图片
}
else
{
$path10=$oldimages5;
}

if($type11==".jpg"  or $type11==".jpge" or $type11==".gif" or $type11==".doc" or $type11==".xls" or $type11==".bmp" or $type11==".pdf" ){
move_uploaded_file($_FILES['images6']['tmp_name'],$path12);//上传图片
$resizeimage = new resizeimage($path12, "200", "100", "0","pic/".$path12);
if($oldimages6!=""){unlink($oldimages6);unlink("pic/".$oldimages6);}//删除旧图片
}
else
{
$path12=$oldimages6;
}
 
if($type13==".jpg"  or $type13==".jpge" or $type13==".gif" or $type13==".doc" or $type13==".xls" or $type13==".bmp" or $type13==".pdf" ){
move_uploaded_file($_FILES['images7']['tmp_name'],$path14);//上传图片
$resizeimage = new resizeimage($path14, "200", "100", "0","pic/".$path14);
if($oldimages7!=""){unlink($oldimages7);unlink("pic/".$oldimages7);}//删除旧图片
}
else
{
$path14=$oldimages7;
}

if($type15==".jpg"  or $type15==".jpge" or $type15==".gif" or $type15==".doc" or $type15==".xls" or $type15==".bmp" or $type15==".pdf" ){
move_uploaded_file($_FILES['images8']['tmp_name'],$path16);//上传图片
$resizeimage = new resizeimage($path16, "200", "100", "0","pic/".$path16);
if($oldimages8!=""){unlink($oldimages8);unlink("pic/".$oldimages8);}//删除旧图片
}
else
{
$path16=$oldimages8;
}





if($query=mysql_query("update ".$webname." set title='$title',entitle='$entitle',BigClassName='$BigClassName',enBigClassName='$enBigClassName',SmallClassName='$SmallClassName',enSmallClassName='$enSmallClassName',content='$content',encontent='$encontent',begintime='$begintime',endtime='$endtime',edittime='$edittime',editname='$editname',linkisok='$linkisok',link1='$link1',link2='$link2',images='$path2',images2='$path4',images3='$path6',images4='$path8',images5='$path10',images6='$path12',images7='$path14',images8='$path16' where id='$id'"))


{
   echo "<script>alert('資料修改成功！');window.location.href='".$linkname.".php?page=".$page."';</script>";
 }
 
 else
  {
   echo "<script>alert('資料修改失敗！');window.location.href='".$linkname.".php?page=".$page."';</script>";
  }
}
?>
 
 
  <div id="contact">
  
  
  
  
  
  
  
  
  
  
  
    <?php 
    $id=make_safe($_GET["id"]);	 
    $sql="select * from ".$webname." where id='$id' order by id desc";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
	?>
 
<form method="post" enctype="multipart/form-data" name="form1"  action="?action=xiugai&id=<?php echo $row->id;?>" target="_self">
   <table border="0" cellpadding="0" cellspacing="0" >
     <tr>
       <td>廣告標題：
         
         <input name="title" type="text" class="contact_add-tit-keyin" value="<?php echo $row->title;?>" /></td>
     </tr>
     <tr>
       <td><ul>
         <li>選擇分類：</li>
         <li>
           <input name="BigClassName" type="radio" value="1" onclick="begin(1)"  <?php if($row->BigClassName=="1"){echo "checked='checked'";}?>  />
          
           大橫幅</li>
         <li>
            <input name="BigClassName" type="radio"  value="2" onclick="end(1)" <?php if($row->BigClassName=="2"){echo "checked='checked'";}?> />
           右邊欄位</li>
         </ul></td>
     </tr>
     <tr>
       <td><ul>
         <li>撰寫時間：<?php echo $row->addtime;?></li>
         <li>發佈時間：<input name="begintime" type="text" style="width:80px" onfocus="c.showMoreDay = false;c.show(this,'<?php echo $data3;?>');" value="<?php echo $row->begintime;?>"></li>
         <li>結束時間：<input name="endtime" type="text" style="width:80px" onfocus="c.showMoreDay = false;c.show(this,'<?php echo $data3;?>');" value="<?php echo $row->endtime;?>"></li>
         <li>點閱次數：<?php echo $row->hits;?></li>
         </ul></td>
     </tr>
     </table>
   <table border="0" cellpadding="0" cellspacing="0" >
     <tr>
       <td>圖片： </td>
     </tr>
     <tr>
       <td>
	   <?php if($row->BigClassName==1){?>
	   <?php if($row->images!=""){?><img src="<?php echo "big/".$row->images;?>" width="190" height="69" />
	    <?php }?>
	    <?php }?>
	   </td>
     </tr>
     <tr>
       <td id="submenu1" style="DISPLAY: <?php if($row->BigClassName=="1"){echo "block";}else{echo "none";}?>"><span class="contact_add-upload">首頁圖：
           
           <input name="images" type="file" size="50"  />
           <input type="hidden" name="oldimages" value="<?php echo $row->images;?>" />
          </span></td>
     </tr>
     <tr>
       <td><?php if($row->images2!=""){?><img src="<?php echo "big/".$row->images2;?>" width="190" height="69" /><?php }?></td>
     </tr>
     <tr>
       <td  class="contact_add-upload">大圖：
      
         <input name="images2" type="file" size="50" />
		 <input type="hidden" name="oldimages2" value="<?php echo $row->images2;?>" />         </td>
     </tr>
     <tr>
       <td  class="contact_add-upload"><?php if($row->images3!=""){?>
         <img src="<?php echo "pic/".$row->images3;?>" width="190" height="69" />         <?php }?></td>
     </tr>
     <tr>
       <td  class="contact_add-upload">小圖：
         
         <input name="images3" type="file" size="50"  />
		 <input type="hidden" name="oldimages3" value="<?php echo $row->images3;?>" />        </td>
     </tr>
    
     </table>
   <table border="0" cellpadding="0" cellspacing="0" >
     <tr>
       <td>廣告內容位置：</td>
     </tr>
	 <tr>
       <td>連結：         
              <input  name="linkisok" type="radio" value="1" <?php if($row->linkisok==1){echo "checked='checked'";}?>  onclick="check_link1()" />
         無連結&nbsp;&nbsp;&nbsp;&nbsp;<input  name="linkisok" type="radio" value="2" <?php if($row->linkisok==2){echo "checked='checked'";}?> onclick="check_link2()" />
         站內連結&nbsp;&nbsp;&nbsp;&nbsp;
         <input  name="linkisok" type="radio" value="3" <?php if($row->linkisok==3){echo "checked='checked'";}?> onclick="check_link3()" />
         外部連結</td>
     </tr>
     <tr>
       <td id="isok1" style="display:<?php if($row->linkisok==2){echo "block";}else{echo "none";}?>"  >站內連結：
         <input name="link1" type="text" class="contact_add-tit-keyin"  value="<?php echo $row->link1;?>" /></td>
     </tr>
     
     <tr>
       <td  id="isok2" style="display:<?php if($row->linkisok==3){echo "block";}else{echo "none";}?>">外部連結：
         http://<input name="link2" type="text" class="contact_add-tit-keyin" value="<?php echo $row->link2;?>" /></td>
     </tr>
     
     </table>
   <table border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td><input type="submit" name="Submit" value="提交修改"  onClick="return check(form);" /></td>
  </tr>
</table>
</form>
 <?php }?>
  </div>
 
 
 
 
 
 
 <script language="javascript">
	function begin(sid){

j=document.getElementById("submenu"+sid);
j.style.display = "";

}

	
function end(sid){
j=document.getElementById("submenu"+sid);
j.style.display = "none";;
}

</script>

<script language="javascript">
function check_link1(){
document.getElementById("isok1").style.display = "none";

document.getElementById("isok2").style.display = "none";

}

function check_link2(){
document.getElementById("isok1").style.display = "block";

document.getElementById("isok2").style.display = "none";

}

function check_link3(){
document.getElementById("isok1").style.display = "none";

document.getElementById("isok2").style.display = "block";

}
</script>
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
  <!--Content for  id "contact_page" Goes Here //-->
  <div id="contact_page">
  
  </div>
</div><!-- main end //-->
</div><!--Wrap end //-->
<div id="botton">
 <?php include_once('ad_sale_botton_btn.php');?>
</div>
</body>
</html>
